/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package saa.dao.periodo.tempo;

import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import saa.dominio.periodo.tempo.Bimestre;

/**
 *
 * @author lobao
 */
@Stateless
public class BimestreDAO implements BimestreDAOInterface {

    @PersistenceContext(unitName = "SAAPU")
    private EntityManager em;

    @Override
    public List<Bimestre> listar() {
        return em.createNamedQuery("Bimestres", Bimestre.class).getResultList();
    }

    @Override
    public List<Bimestre> listar(long idAluno) {
        return em.createNamedQuery("Bimestre.id", Bimestre.class).setParameter("id", idAluno).getResultList();
    }

}
